This page last changed on Apr 13, 2010 by tm.

BeagleBoard and USB Harddisk Preparation Instructions

Summary

1. Prepare Host

2. Create Bootable SD Card

3. Using Bootable SD card, update the BeagleBoard NAND flash

Prepare the Host
  1. Recommended: use VMWare Player v3.01 to host Ubuntu Linux.   (30G, one big file for easy backup) 
  2. Install Ubuntu 9.04 (Jaunty Jackal)
  3. sudo apt-get install gparted libasound2 uboot-mkimage
    1. Make sure libasound2 is installed on the host
  4. Install Eclipse for c/c++ (Galileo)
  5. Copy McStar files to the Ubuntu desktop
Create Bootable SD Card
  1. Format SD into 128 MB FAT 32 partition and the remainder as EXT3 using "sudo gparted"
  2. Remove and re-insert SD card
  3. sudo chown $USER /media/disk
  4. sudo chown $USER /media/disk-1
    Important Note
    Copy the files below in exactly the order given, no exceptions
    Install first boot loader, U-Boot, kernel image and U-Boot scripts
  5. Copy MLO from ~/Common to FAT32 partition
  6. Copy u-boot.bin from either ~/C3 or ~/C4 to the FAT32 partition
  7. Copy uImage.bin from ~/Common to the FAT32 partition
  8. Copy xload-bin-ift from ~/Common to the FAT32 partition
  9. Copy boot.scr from ~/Common to the FAT32 partition
  10. Unmount the FAT32 partition
  11. cd to the EXT3 partition
    SD Card
    Copy the root file system to the SD card
  12. 12 (13). Copy ~/common/mcstar-rootfs*.tar.bz2 to /home/root on the EXT3 partition
  13. 13 (12). Enter "sudo tar xvjf mcstar-rootfs*.tar.bz2"
  14. Unmount EXT3 partition
    SD Boot
    Force a boot the Beagleboard from the SD card
  15. Power off the Beagleboard, attach serial port cable
  16. Start hyperterm or picocom on host "picocom -b 115200 /dev/ttyS0 or /dev/ttyUSB0"
  17. Insert Card into Beagleboard and connect power to Beagleboard
  18. Stop autoboot by pressing return within 10 seconds
  19. Press and hold user button on Beagleboard
  20. Press and release the reset button while pressing the user button
  21. Stop autoboot by pressing return within 10 seconds
    Install Root Filesys
    Install the root file system as a JFFS2 partition on the NAND Flash
  22. At the Linux prompt, type "root" with no password
  23. Enter "halt"
  24. Power off the Beagbleboard when there is no response to "enter"
  25. Attach the USB to Ethernet dongle to the EHCI port, connect to network
  26. Stop autoboot by pressing return within 10 seconds
  27. Press and hold user button on Beagleboard
  28. Press and release the reset button while pressing the user button
  29. AT the Linux prompt, type "root" with no password
    JFFS2 Setup
    Get the necessary libraries and utilities for JFFS2
  30. opkg update
  31. opkg upgrade
  32. opkg install mtd-utils bzip2
    1. # Make sure mtd-utils works#
  33. cat /proc/mtd
    1. # You should see the following:
    2. # dev: size erasesize name
    3. # mtd0: 00080000 00020000 "X-Loader"
    4. # mtd1: 001e0000 00020000 "U-Boot"
    5. # mtd2: 00020000 00020000 "U-Boot Env"
    6. # mtd3: 00400000 00020000 "Kernel"
    7. # mtd4: 0f980000 00020000 "File System"
    8. # Erase and remove bad block from the mtd partition (root file system)
  34. Enter "flash_eraseall -j /dev/mtd4"
    1. # Mount the mtd partition and format it as JFFS2#
  35. Enter "cd /mnt"
  36. Enter "mkdir nand"
  37. Enter "mount -t jffs2 /dev/mtdblock4 /mnt/nand"
    Extract root filesys
    Extract the root file system from the SD card into the JFFS2 partition
  38. Enter "cd nand"
    Extracting tar
    Extracting the root file system takes about 5 minutes
  39. Enter "tar xvjf /home/root/mcstar-rootfs*.tar.bz2"
  40. Enter "cd .."
  41. Enter "sync"
  42. Enter "umount nand"
    Reboot board
  43. Enter "shutdown now" and wait at least 45 seconds
  44. Remove the SD card
  45. Apply power to the beagleboard
  46. Enter "root" at the Linux prompt
    1. # Install sound libraries and utilities need to build the McStar application on the root file system
  47. opkg update
  48. opkg upgrade
  49. opkg install task-native-sdk cpp gccmakedep gdb
  50. opkg install nano
  51. opkg install lrzsz
  52. opkg install task-base-alsa task-base-alsa-dev
  53. opkg install alsa-conf alsa-conf-base alsa-dev alsa-lib-dev
  54. opkg install alsa-utils alsa-utils-aplay
  55. set the date for the software clock
  56. date -s "<Today's Date> <Today's Time>"
    1. # Set the RTC, only if a battery has been installed on the Beagleboard#
  57. set the battery backed RTC, "hwclock -w"
    1. # Build the McStar Natively#
  58. Enter "shutdown now".
  59. Power off Beagleboard
  60. Remove Ethernet Dongle from the Beagleboard
    Copy McStar app from host to harddrive
  61. Attach a freshly EXT3 formatted USB drive to the host
  62. Enter "cp -R ~/McStar/app /media/sda1/."
  63. Unmount USB drive
  64. Remove the USB host from the host and connect it to the Beagleboard
  65. Power up the Beagleboard
  66. Enter "root" at the Linux prompt
  67. Enter "cd /media/sda1/app/src"
  68. Enter "touch Makefile *.h *.cpp"
  69. Enter "make clean"
  70. Enter "make"
    1. # Test the McStar App for 10 minutes, writing a new file every minute
  71. Enter "mkdir /media/sda1/data"
  72. Enter "cd /media/sda1/app/scripts"
  73. Enter "./test_mcstar.sh"


Notes on Beagel Board and SD Card Copy

Copy Linux filesystem on bootable SD card

This tutorial is part of our Tutorials section. It shows how to flash an image onto an SD/SDHC card.

This guide assumes that the card is correctly partitioned, as described in the Create a bootable SD/SDHC card in Ubuntu tutorial.

Steps in this tutorial

  1. Mount the SD/SDHC card (if not already mounted)
  2. Write bootloader if necessary
  3. Write Linux kernel image
  4. Write Linux root file system
  5. Unmount

Quick Solution: Copy an already existing card

If you have already one working SD image and an (absolutely similar) formatted second card, you can just copy them. WARNING Please be aware that the filesystem names (/dev/sdb1, etc.) can differ from system to system, make sure to select the right one.

Copy one SD card to another: sudo dd if=/dev/sdb of=/dev/sdcThe safer alternative: Copy the SD card to harddisk and then onto another sudo dd if=/dev/sdb of=/sd-card-copy.binNow back on the second SD card: sudo dd if=/sd-card-copy.bin of=/dev/sdb

Mount SD/SDHC card

Check where linux mounted the card. One way is to check this via mount .
Call mount to see where the card has been mounted. Two partitions should have been mounted, one named '/media/BOOT' and the other one '/media/LINUX'. Note the device name, e.g. '/dev/sdb'. mountIf the card has not been mounted, you have two choices:

Automatic

Just unplug and re-plug the cardreader. It will be detected and mounted automatically.

Manually

If the check with mount didn't work out, use dmesg: dmesg | tailWatch out for a line like this: sdc Attached SCSI removable diskWhere sdc could also be sdc or sdd. If it was sdb, the device name of the memory card is /dev/sdc. sudo mkdir -p /media/BOOT
sudo mount /dev/sdc1 /media/BOOT
sudo mkdir -p /media/LINUX
sudo mount /dev/sdc2 /media/LINUX

Copy files on the BOOT partition (MLO, u-boot.bin and uImage)

Please note that the bootloader files don't have to be rewritten every time. This applies especially when a new custom Linux system is created with BitBake and OpenEmbedded_. However if you work close to the hardware, e.g. on drivers, this is different._

Overo

Download MLO and uBoot from this link (commands for shell below):

  • PIXHAWK OpenEmbedded Images Download (OpenCV and libdc1394 ready)

IMPORTANT: Copy MLO FIRST!.

The commands below download the two files and copy them in the right order on the boot partition. You may have to adjust the filenames for future revisions. cd $HOME
wget http://pixhawk.ethz.ch/wiki/_media/symlink/images/overo/mlo-overo
wget http://pixhawk.ethz.ch/wiki/_media/symlink/images/overo/u-boot.bin-overoAnd now copy the two files onto the boot partition (MLO first because of a bug in the X-loader which causes problems if MLO is not the first file written onto the boot partition). cp MLO-overo* /media/BOOT/MLO
cp u-boot.bin-overo* /media/BOOT/u-boot.bin The Linux kernel (uImage) resides also on the BOOT partition of the SD-card. If you compile a new version of the kernel you have to copy the new uImage on the BOOT partition. See the instructions below.

BeagleBoard

Download MLO and uBoot from this link (commands for shell below):

IMPORTANT: Copy MLO FIRST!.

The commands below download the two files and copy them in the right order on the boot partition. You may have to adjust the filenames for future revisions. cd $HOME
wget http://www.angstrom-distribution.org/demo/beagleboard/MLO
wget http://www.angstrom-distribution.org/demo/beagleboard/u-boot.binAnd now copy the two files onto the boot partition (MLO first because of a bug in the X-loader which causes problems if MLO is not the first file written onto the boot partition). cp MLO /media/BOOT/MLO
cp u-boot.bin /media/BOOT/u-boot.bin The Linux kernel (uImage) resides also on the BOOT partition of the SD-card. If you compile a new version of the kernel you have to copy the new uImage on the BOOT partition. See the instructions below.

Copy Linux

The next step is to copy the Linux kernel and the Linux root filesystem on the BOOT and LINUX partitions. You can use precompiled binaries for both or compile an OpenEmbedded image yourself. Instructions for both options are provided below.

Copy the precompiled Ångström Image

The precompiled Ångström image consists (besided MLO and u-boot.bin from the bootloader section) of two files: The Linux kernel image (uImage) and the root file system.

Copy uImage

Download and copy the kernel image into the root directory of the boot partition.

Gumstix Overo

cd $HOME
wget http://pixhawk.ethz.ch/wiki/_media/symlink/images/overo/uimage.bin-overo
cp uimage.bin-overo* /media/BOOT/uImage

BeagleBoard

cd $HOME
wget http://www.angstrom-distribution.org/demo/beagleboard/uImage
cp uImage /media/BOOT/uImage

Copy the Linux root file system

The file is named rootfs.tar.bz2 for the Beagle link and omap3-desktop-image-overo-.tar.bz2 for the Overo link below. Check the main folder for the current name.

Download the files to a temporary directory, e.g. the Desktop or your user folder. The next step is to extract these files into the LINUX partition (NOT the boot partition). This can only be done by using Linux. If you're using Windows or MacOS, read this.

Gumstix Overo

If you have downloaded the console image: wget http://pixhawk.ethz.ch/wiki/_media/symlink/images/overo/pixhawk-console-image-overo.tar.bz2
sudo tar xjf pixhawk-console-image-overo-*.tar.bz2 -C /media/LINUXOr the desktop image: wget http://pixhawk.ethz.ch/wiki/_media/symlink/images/overo/pixhawk-desktop-image-overo.tar.bz2
sudo tar xjf pixhawk-desktop-image-overo-.tar.bz2 C /media/LINUXpossibly, "pixhawk-desktop-image-overo.tar.bz2" has to be changed into "pixhawk-console-image-overo.tar.bz2" (just adept file name)

BeagleBoard

sudo tar xjf *rootfs.tar.bz2 -C /media/LINUX

Copy custom OpenEmbedded Linux Image

Linux Kernel Image and u-boot bootloader

Copy the kernel image and u-boot.

Gumstix Overo

sudo cp $OE_HOME/tmp/deploy/glibc/images/overo/uImage-overo.bin /media/BOOT/uImage
cp $OE_HOME/tmp/deploy/glibc/images/overo/u-boot-overo.bin /media/BOOT/u-boot.bin

BeagleBoard

sudo cp $OE_HOME/tmp/deploy/glibc/images/beagleboard/uImage-beagleboard.bin /media/BOOT/uImage
cp $OE_HOME/tmp/deploy/glibc/images/beagleboard/u-boot-beagleboard.bin /media/BOOT/u-boot.bin

Linux root filesystem

After the kernel, the root filesystem has to be copied as well. If you are overwriting an existing installation and you don't need a 100% clean system, you can just delete all files. The command below will delete all files in /media/LINUX except the lost+found directory of the EXT3 file system. sudo rm -rf /media/LINUX/* && sudo mkdir /media/LINUX/lost+foundHowever if you want a really clean disk, you should format it, but this will take considerably longer. sudo mkfs.ext3 -L LINUX /dev/sdc2And now copy the new files.

Gumstix Overo

The console image: sudo tar xjf $OE_HOME/tmp/deploy/glibc/images/overo/omap3-console-image-overo.tar.bz2 -C /media/LINUXThe pixhawk console image: sudo tar xjf $OE_HOME/tmp/deploy/glibc/images/overo/pixhawk-console-image-overo.tar.bz2 -C /media/LINUXOr the desktop image: sudo tar xjf $OE_HOME/tmp/deploy/glibc/images/overo/omap3-desktop-image-overo.tar.bz2 -C /media/LINUX

BeagleBoard

The console image: sudo tar xjf $OE_HOME/tmp/deploy/glibc/images/beagleboard/omap3-console-image-beagleboard.tar.bz2 -C /media/LINUXOr the desktop image: sudo tar xjf $OE_HOME/tmp/deploy/glibc/images/beagleboard/omap3-desktop-image-overo.beagleboard.bz2 -C /media/LINUX

Unmount the SD/SDHC card

Now unmount the drive either manually (by clicking the unmount icon on the desktop) or by shell command: sync
sudo umount /media/BOOT
sudo umount /media/LINUX
sudo rm -r /media/BOOT
sudo rm -r /media/LINUX

Copy bytewise from one SDHC card to another

If you have modified your installation and want to clone the content of the SD card, you can do this with dd.

Make sure to plug in the source card first, then the destination card. Check the file names with: dmesg | tailAnd unmount the card (with the GUI or with umount /dev/sdb). Then use dd to copy the first gigabyte from one card to the other (including partition table, etc.): sudo dd if=/dev/sdb of=/dev/sdc bs=1073741824

Document generated by Confluence on Feb 03, 2026 16:22